export const daemonCmd = {
  hdc: {
    getPid: (SN) => `hdc ${SN ? `-t ${SN}` : ''} shell pidof SP_daemon`,
    killPid: (SN, pids) => `hdc ${SN ? `-t ${SN}` : ''} shell kill ${pids}`,
    setScreenLight: (SN) =>
      `hdc ${SN ? `-t ${SN}` : ''} shell power-shell setmode 602`,
    delDaemon: (SN) =>
      `hdc ${SN ? `-t ${SN}` : ''} shell  rm -rf /data/local/tmp/SP_daemon`,
    sendDaemon: (SN, localPath) =>
      `hdc ${SN ? `-t ${SN}` : ''} file send ${localPath} /data/local/tmp`,
    findDaemon: (SN) =>
      `hdc ${SN ? `-t ${SN}` : ''} shell find ./data/local/tmp/ -name SP_daemon`,
    chmod: (SN) =>
      `hdc ${SN ? `-t ${SN}` : ''} shell chmod 777 /data/local/tmp/SP_daemon`,
    startServer: (SN) =>
      `hdc ${SN ? `-t ${SN}` : ''} shell "LD_LIBRARY_PATH=/data/local/tmp/ /data/local/tmp/SP_daemon"`,
    startSystemServer: (SN) =>
      `hdc ${SN ? `-t ${SN}` : ''} shell "LD_LIBRARY_PATH=/system/bin/ SP_daemon"`,
    setPort: (SN) => `hdc ${SN ? `-t ${SN}` : ''} fport tcp:12345 tcp:8284`,
    delPort: (SN) => `hdc ${SN ? `-t ${SN}` : ''} fport rm tcp:12345 tcp:8284`,
    getVersion: (SN) =>
      `hdc ${SN ? `-t ${SN}` : ''} shell "/data/local/tmp/SP_daemon --version"`,
    clearCapture: (SN) =>
      `hdc ${SN ? `-t ${SN}` : ''} shell rm -rf /data/local/tmp/capture/*`,
    isCollectorFileExist: (devId, file) =>
      `hdc ${devId ? `-t ${devId}` : ''} shell "ls -al /data/local/tmp/${file}`,
    pushCollectorFile: (devId, file) =>
      `hdc ${devId ? `-t ${devId}` : ''} file send ${file} /data/local/tmp/`,
    chmodCollectorFile: (devId, file) =>
      `hdc ${devId ? `-t ${devId}` : ''} shell "chmod 777 /data/local/tmp/${file}`,
  },
};
